import { createStore } from 'vuex'
import user from '@/store/modules/user'
import cate from '@/store/modules/cate'
import cart from '@/store/modules/cart'
import global from '@/store/modules/global'
import createPersistedstate from 'vuex-persistedstate'

export default createStore({
  // 全局模块
  ...global,
  // 局部模块
  modules: {
    user,
    cate,
    cart
  },
  plugins: [
    createPersistedstate({
      key: 'erabbit-client-pc-store',
      paths: ['user', 'cart']
    })
  ]
})
